<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index10-1</title>
</head>
<body>
<a href="index10-2.html">index10-2</a>
<input type="button" value="跳转到baidu" onclick="gotoBaidu()"/>
<script type="text/javascript">

    // 获取
    // console.log(window.location.href);
    function gotoBaidu(){
        // 给location.href设置值，自动跳转到指定页面
        window.location.href = 'http://www.baidu.com';
    }
</script>
</body>
</html>